import { tt_impl } from "../thinapi/common/ttimpl_web/ttimpl_web.js"
import { tt, GameApp, ResourceOption } from "./common.js";
import { MainWin } from "./mainwin.js";
import { IOExt } from "../xioext/ioext.js";
window.onload = async () => {
    IOExt.Init();
    //初始化tt engine.

    let canvas = document.createElement("canvas");
    canvas.style.position = "absolute";
    canvas.style.width = "100%";
    canvas.style.height = "100%"
    document.body.appendChild(canvas);

    let ttimpl = new tt_impl.ttimpl_browser()
    ttimpl.Init(canvas);

    var fontname = await tt.loaderex.LoadCustomFont("VonwaonBitmap", "./resource/VonwaonBitmap-16px.ttf");
    let op = new ResourceOption();
    op.defFontName = fontname;
    GameApp.Start(op, new MainWin())
}